#define _CRT_SECURE_NO_WARNINGS 1

#include "Vector.h"

class Solution 
{
public:

    lwd::vector<int> twoSum(lwd::vector<int>& numbers, int target)
    {
        int n = numbers.size();
        int left = 0, right = n - 1;
        int sum = 0;
        while (left < right)
        {
            sum = numbers[left] + numbers[right];
            if (sum < target)
            {
                left++;
            }
            else if (sum > target)
            {
                right--;
            }
            else return{ left, right };
        }
        return{ -1, -1 };
    }
};

int main()
{
    lwd::vector<int> v;
    v.push_back(2);
    v.push_back(7);
    v.push_back(11);
    v.push_back(15);
    v.push_back(19);
    v.push_back(21);

    Solution s;
    s.twoSum(v, 30);
    return 0;
}